<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Artist View</title>
	</head>
	<body>
		<!-- user login/logout -->
		<s:if test="logged==true">
			<div style="text-align:rigth"><s:property value="loggedUser"/>&nbsp;<a href="logout">Logout</a></div>
		</s:if>
		<s:else>
			<div style="text-align:rigth"><a href="login">Login</a></div>
		</s:else>
		<!-- content -->
		<table>
			<tr>
				<td>
					<!-- Header -->
					<table>
						<tr>
							<td><img width="150" src="image/${artist.name}.jpg"/></td>
							<td><h1>${artist.name}</h1></td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<!-- Albums -->
					<table>
						<thead style="background-color:grey;">
							<tr>
								<th colspan="2">Recording</th>
								<th align="center">Format</th>
								<th align="center">Year</th>
								<th>Title</th>
							</tr>
						</thead>
						<s:iterator value="artist.albums">
							<tr>
								<td><a href="albumView?catalog=${catalog}">Балкантон <s:property value="catalog"/></a></td>
								<td><img src="image/${catalog}.jpg" height="50" width="50"/></td>
								<td><s:property value="format"/></td>
								<td><s:property value="released"/></td>
								<td><s:property value="title"/></td>
							</tr>
						</s:iterator>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<!-- Credits -->
					<table>
						<tr style="background-color:grey;"><th>Role:</th><th>Name:</th><th>Tracks:</th></tr>
						<s:iterator value="artist.credits">
							<tr>
								<td><s:property value="role"/></td>
								<td><a href="albumView?catalog=${album.catalog}">Балкантон <s:property value="album.catalog"/></a></td>
								<td><s:property value="tracks"/></td>
							</tr>
						</s:iterator>
					</table>
				</td>
			</tr>
		</table>
	</body>
</html>